
package com.contactmodule.bean;

import com.companymodule.bean.TbCompany;
import com.companymodule.dao.TbCompanyDAO;
import com.contactmodule.dao.TbDepartDAO;
import com.usersmodule.bean.TbUsers;
import com.usersmodule.dao.TbUsersDAO;

public class TbContact implements java.io.Serializable {

    private int contactId;

    private String contactName;

    private int companyId;
    private TbCompany tbCompany;
    
    private int departId;
    private TbDepart tbDepart;

    private String contactSex;

    private String contactPhone;

    private String contactEmail;

    private String contactBirthday;

    private String contactAddress;

    private int contactState;

    private int userId;
    private TbUsers tbUsers;

    private String createTime;

    public int getContactId(){
        return contactId;
    }

    public void setContactId(int contactId){
        this.contactId = contactId;
    }

    public String getContactName(){
        return contactName;
    }

    public void setContactName(String contactName){
        this.contactName = contactName;
    }

    public int getDepartId(){
        return departId;
    }

    public void setDepartId(int departId){
        this.departId = departId;
        this.tbDepart=new TbDepartDAO().getTbDepartByDepartId(departId);
    }
    
    public TbDepart getTbDepart() {
		return tbDepart;
	}

	public TbUsers getTbUsers() {
		return tbUsers;
	}

	public String getContactSex(){
        return contactSex;
    }

    public void setContactSex(String contactSex){
        this.contactSex = contactSex;
    }

    public String getContactPhone(){
        return contactPhone;
    }

    public void setContactPhone(String contactPhone){
        this.contactPhone = contactPhone;
    }

    public String getContactEmail(){
        return contactEmail;
    }

    public void setContactEmail(String contactEmail){
        this.contactEmail = contactEmail;
    }

    public String getContactBirthday(){
        return contactBirthday;
    }

    public void setContactBirthday(String contactBirthday){
        this.contactBirthday = contactBirthday;
    }

    public String getContactAddress(){
        return contactAddress;
    }

    public void setContactAddress(String contactAddress){
        this.contactAddress = contactAddress;
    }

    public int getContactState(){
        return contactState;
    }

    public void setContactState(int contactState){
        this.contactState = contactState;
    }

    public int getUserId(){
        return userId;
    }

    public void setUserId(int userId){
        this.userId = userId;
        this.tbUsers=new TbUsersDAO().getTbUsersByUserId(userId);
    }

    public String getCreateTime(){
        return createTime;
    }

    public void setCreateTime(String createTime){
        this.createTime = createTime;
    }


    public TbContact(){
    }
    public TbContact(String contactName,int departId,String contactSex,String contactPhone,String contactEmail,String contactBirthday,String contactAddress,int contactState,int userId){
        this.contactName = contactName;
        this.departId = departId;
        this.contactSex = contactSex;
        this.contactPhone = contactPhone;
        this.contactEmail = contactEmail;
        this.contactBirthday = contactBirthday;
        this.contactAddress = contactAddress;
        this.contactState = contactState;
        this.userId = userId;
    }
    public TbContact(String contactName,int companyId,int departId,String contactSex,String contactPhone,String contactEmail,String contactBirthday,String contactAddress,int contactState,int userId){
        	this.contactName = contactName;
        	this.companyId = companyId;
        	this.departId = departId;
        	this.contactSex = contactSex;
        	this.contactPhone = contactPhone;
        	this.contactEmail = contactEmail;
        	this.contactBirthday = contactBirthday;
        	this.contactAddress = contactAddress;
        	this.contactState = contactState;
        	this.userId = userId;
        }
    public TbContact(int contactId,int companyId,String contactName,int departId,String contactSex,String contactPhone,String contactEmail,String contactBirthday,String contactAddress,int contactState,int userId){
        this.contactId = contactId;
        this.companyId = companyId;
        this.contactName = contactName;
        this.departId = departId;
        this.contactSex = contactSex;
        this.contactPhone = contactPhone;
        this.contactEmail = contactEmail;
        this.contactBirthday = contactBirthday;
        this.contactAddress = contactAddress;
        this.contactState = contactState;
        this.userId = userId;
    }
    public TbContact(int contactId,String contactName,String contactSex,String contactPhone,String contactEmail,String contactBirthday,String contactAddress,int contactState,int userId){
    	this.contactId = contactId;
    	this.contactName = contactName;
    	this.contactSex = contactSex;
    	this.contactPhone = contactPhone;
    	this.contactEmail = contactEmail;
    	this.contactBirthday = contactBirthday;
    	this.contactAddress = contactAddress;
    	this.contactState = contactState;
    	this.userId = userId;
    }

	public int getCompanyId() {
		return companyId;
	}

	public void setCompanyId(int companyId) {
		this.companyId = companyId;
		this.tbCompany = new TbCompanyDAO().getTbCompanyByCompanyId(companyId);
	}

	public TbCompany getTbCompany() {
		return tbCompany;
	}

	public void setTbCompany(TbCompany tbCompany) {
		this.tbCompany = tbCompany;
	}

	public void setTbDepart(TbDepart tbDepart) {
		this.tbDepart = tbDepart;
	}

	public void setTbUsers(TbUsers tbUsers) {
		this.tbUsers = tbUsers;
	}
}

